//
//  ViewController.m
//  UINavgationBar
//
//  Created by GivenBmli on 16/7/21.
//  Copyright © 2016年 GivenBmli. All rights reserved.
//

#import "ViewController.h"

#define kSreenBounds [UIScreen mainScreen].bounds
#define kSreenWith kSreenBounds .size.width
#define kSreenHeight kSreenBounds .size.height
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UISegmentedControl *segMent = [[UISegmentedControl alloc]initWithItems:@[@"消息",@"电话"]];
    segMent.frame = CGRectMake(0, 0, 150, 30);
    self.navigationItem.titleView = segMent;
    segMent.tintColor = [UIColor whiteColor];
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.000 green:0.502 blue:1.000 alpha:1.000];
    UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
    rightButton.frame = CGRectMake(kSreenWith,44, 0, 0);
    rightButton.backgroundColor =[UIColor whiteColor];
    
    [rightButton setImage:[UIImage imageNamed:@"GreenMe2x.png"] forState:UIControlStateNormal];
    [self.view addSubview:rightButton];




}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
